<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript 对象访问器</title>
</head>
<body>
<p id="demo"></p>
<script>
  var person = {
    firstName: "Bill",
    lastName : "Gates",
    language : "",
    set lang(lang) {
      this.language = lang.toUpperCase();
    }
  };
  //使用set设置属性
  person.lang = "en"
  //显示对象的数据
  document.getElementById("demo").innerHTML =
          person.language;
</script>
</body>
</html>